<template>
    <div id="InterNet">
        <div class='jx-content'>
            <div class="topcoumt">
                <div class="search-box fl">
                    <el-form :inline="true"  :model="Form" class="fl">
                        <el-form-item label="教师信息 :">
                             <el-input v-model="Form.info" placeholder="请输入教师信息" maxlength="20"></el-input>
                        </el-form-item>
                        <el-form-item label="角色 ："  style="margin-left:-30px;">
                            <el-select v-model="Form.role" placeholder="请选择角色">
                                <el-option
                                v-for="item in Form.options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.label">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-form>
                    <button class="button-style" @click="searchFn">搜 索</button>
                </div>
                <div class="btn-group fr">
                     <button class="button-style"  @click="deleteAll()" >批量删除</button>
                 </div>
                <div class="btn-group fr">
                    <button class="button-style"  @click="add()" >添 加</button>
                </div>
            </div>
            <div class="table">
               <el-table :data="tableData" style="width: 100%"  @selection-change="handleSelectionChange">
                    <el-table-column  type="selection" width='50'> </el-table-column>
                    <el-table-column prop="name" label="教师名称"></el-table-column>
                    <el-table-column prop="userNumber" label="工号" ></el-table-column>
                    <el-table-column prop="roleName" label="角色"></el-table-column>
                    <el-table-column prop="province" label="省份"> </el-table-column>
                    <el-table-column prop="schoolName" label="学校"> </el-table-column>
                    <el-table-column prop="applicant" label="申请人"> </el-table-column>
                    <el-table-column prop="createTime" label="创建日期"> </el-table-column>
                    <el-table-column prop="destroyTime" label="截止日期"> </el-table-column>
                    <el-table-column prop="statusName" label="状态"> </el-table-column>
                    <el-table-column  label="操作" width='180'>
                         <template slot-scope="scope">
                            <el-button type="text" size="small" style="color:#959595"  v-if="scope.row.allowedModified==false" >修改</el-button>
                            <el-button type="text" size="small"
                               @click="repeatFn(scope.row.id,scope.row.name,scope.row.userNumber,scope.row.sexName,scope.row.roleName,scope.row.telephoneNumber,scope.row.email,
                               scope.row.applicant, scope.row.destroyTime,scope.row.province,scope.row.schoolName)"
                               v-if="scope.row.allowedModified==true" >
                                修改
                            </el-button>
                            <el-button type="text" size="small"  @click="active(scope.row.id,scope.row.status)" v-if="scope.row.allowedModified==false">激活</el-button>
                            <el-button type="text" size="small"   @click="cacncel(scope.row.id,scope.row.status)"  v-if="scope.row.allowedModified==true">销户</el-button>
                            <el-button type="text" size="small"  @click="repeatCode(scope.row.id)" v-if="scope.row.allowedModified==true" >初始密码</el-button>
                            <el-button type="text" size="small"   style="color:#959595"  v-if="scope.row.allowedModified==false" >初始密码</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
             <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="currentPage"
                    :page-size="pagesize"
                    layout="total, prev, pager, next, jumper"
                    :total="totalCount"
             ></el-pagination>
              <el-dialog :close-on-click-modal="false" title="添加教师" :visible.sync="dialogVisible" width="650px"  @close="closeDialog">
                <el-form ref="formlist" :inline="true"  :rules="rules" :model="formlist" >
                    <el-form-item label="姓名 :" prop="name">
                        <el-input v-model="formlist.name" placeholder="请输入姓名" maxlength="10"></el-input>
                    </el-form-item>
                    <el-form-item label="工号 :" prop="number">
                        <el-input v-model="formlist.number" placeholder="请输入工号"></el-input>
                    </el-form-item>
                    <el-form-item label="手机号 :"   prop="telephone">
                        <el-input v-model="formlist.telephone" placeholder="请输入手机号"></el-input>
                    </el-form-item>
                    <el-form-item label="销毁日期 :" prop="week">
                         <el-date-picker
                            v-model="formlist.week"
                            type="date"
                            @change="changeTime"
                            placeholder="请选择销毁日期"
                            :picker-options="pickerBeginDateBefore"
                            format="yyyy/M/d"
                            value-format="yyyy/M/d">
                            </el-date-picker>
                    </el-form-item>
                    <el-form-item label="申请人 :" prop="applicant">
                        <el-input v-model="formlist.applicant" placeholder="请输入申请人"></el-input>
                    </el-form-item>
                     <el-form-item label="省份 :"  prop="provinces">
                          <el-select v-model="formlist.provinces"  placeholder="请选择省份">
                            <el-option
                            v-for="item in formlist.provincesList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.label">
                            </el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="学校 :" prop="school" >
                        <el-input v-model="formlist.school" placeholder="请输入学校"></el-input>
                    </el-form-item>
                    <el-form-item label="邮箱 :" prop="email"  >
                        <el-input v-model="formlist.email" placeholder="请输入邮箱号"></el-input>
                    </el-form-item>
                     <el-form-item label="角色：" prop="role" >
                        <el-select v-model="formlist.role" placeholder="请选择角色">
                            <el-option
                            v-for="item in formlist.options"
                            :key="item.label"
                            :label="item.label"
                            :value="item.label">
                            </el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="性别 :"  prop="gender">
                        <el-radio-group v-model="formlist.gender">
                            <el-radio label="男"></el-radio>
                            <el-radio label="女"></el-radio>
                        </el-radio-group>
                    </el-form-item>
                     <el-form-item label="密 码 :" prop="passWord">
                        <el-input type="password" v-model="formlist.passWord" maxlength="14" placeholder="请输入密码"></el-input>
                    </el-form-item>
                    <el-form-item label="确认密码 :" prop="checkPass">
                        <el-input  type="password"  v-model="formlist.checkPass"  maxlength="14" placeholder="请输入确认密码"></el-input>
                    </el-form-item>
                </el-form>
                <div class="btn-center" style="text-align: center;">
                    <button class="button-style" @click="submit('formlist')" >保 存</button>
                </div>
             </el-dialog>
                <el-dialog :close-on-click-modal="false"  title="修改教师" :visible.sync="dialogVisibleable" width="35%" @close="closeDialogaa" >
                 <el-form ref="formlist2" :inline="true"  :rules="rules" :model="formlist2" >
                    <el-form-item label="姓 名 :" prop="name">
                        <el-input v-model="formlist2.name" placeholder="请输入姓名"  maxlength="10" ></el-input>
                    </el-form-item>
                    <el-form-item label="工 号 :" prop="number">
                        <el-input v-model="formlist2.number" placeholder="请输入工号" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="手机号 :"  prop="telephone">
                        <el-input v-model="formlist2.telephone" placeholder="请输入手机号"></el-input>
                    </el-form-item>
                    <el-form-item label="销毁日期:"  prop="week">
                         <el-date-picker
                            v-model="formlist2.week"
                            type="date"
                            @change="changeTime"
                            placeholder="请选择销毁日期"
                            :picker-options="pickerBeginDateBefore"
                            format="yyyy/M/d"
                            value-format="yyyy/M/d">
                            </el-date-picker>
                    </el-form-item>
                    <el-form-item label="申请人 :" prop="applicant">
                        <el-input v-model="formlist2.applicant" placeholder="请输入申请人"></el-input>
                    </el-form-item>
                     <el-form-item label="省 份 :" >
                        <!-- <el-input v-model="formlist2.provinces" placeholder="请输入省份"></el-input> -->
                         <el-select v-model="formlist2.provinces"  placeholder="请选择省份">
                            <el-option
                            v-for="item in formlist.provincesList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.label">
                            </el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="学 校 :" >
                        <el-input v-model="formlist2.school" placeholder="请输入学校"></el-input>
                    </el-form-item>
                    <el-form-item label="邮 箱 :" >
                        <el-input v-model="formlist2.email" placeholder="请输入邮箱号"></el-input>
                    </el-form-item>
                     <el-form-item label="角 色 ：" prop="role" >
                        <el-select v-model="formlist2.role" placeholder="请选择角色" disabled>
                            <el-option
                            v-for="item in formlist.options"
                            :key="item.label"
                            :label="item.label"
                            :value="item.label">
                            </el-option>
                        </el-select>
                    </el-form-item>
                     <el-form-item label="性 别 :" >
                        <el-radio-group v-model="formlist2.gender">
                            <el-radio label="男"></el-radio>
                            <el-radio label="女"></el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-form>
                <div class="btn-center" style="text-align: center;">
                    <button class="button-style" @click="submitFn('formlist2')" >保 存</button>
                </div>
             </el-dialog>
             <el-dialog :close-on-click-modal="false"  title="激活选项" :visible.sync="dialog" width="400px"  @close="closeDialogDate">
                <el-form  :inline="true"  :model="destructionDate"  ref="destructionDate" >
                    <el-form-item label="销毁日期:">
                        <el-date-picker
                            v-model="destructionDate.time"
                            type="date"
                            @change="changeTime"
                            placeholder="请选择销毁日期"
                            :picker-options="pickerBeginDateBefore"
                            format="yyyy/M/d"
                            value-format="yyyy/M/d">
                            </el-date-picker>
                    </el-form-item>
                </el-form>
                <div class="btn-center" style="text-align: center;">
                    <button class="button-style" @click="Save" >保 存</button>
                </div>
             </el-dialog>
        </div>
    </div>
</template>

<script>
    export default {
        data () {
             //邮箱
            var validateEmail = (rule, value, callback) => {
                if (value === '') {
                callback(new Error('请正确填写邮箱'));
                } else {
                if (value !== '') {
                    var reg=/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
                    if(!reg.test(value)){
                    callback(new Error('请输入有效的邮箱'));
                    }
                }
                callback();
                }
            }
            //手机号验证
            var validPhone = (rule, value,callback)=>{

                if (!value){
                    callback(new Error('请输入电话号码'))
                }else {
                    if (value !== '') {
                        var reg=/^1[3456789]\d{9}$/;
                        if(!reg.test(value)){
                        callback(new Error('请输入正确的11位手机号码'));
                        }
                    }
                    callback();
                    }
            }
             // 密码验证
            var validatePass = (rule, value, callback) => {
                let self =this
                if (value === '') {
                    callback(new Error('请输入密码'))
                } else if(value !== ''){
                    var reg=/^[a-zA-Z0-9]{6,14}$/;
                    if(!reg.test(value)){
                        callback(new Error('请输入6-14位数字或中英文字符'))
                    }
                     if (self.formlist.checkPass !== '') {
                        self.$refs.formlist.validateField('checkPass')
                    }
                }
                callback()
            }
			var validatePass2 = (rule, value, callback) => {
                let self =this
				if (value === '') {
					callback(new Error('请再次输入密码'))
                } else if (value !== ''){
                    var reg=/^[a-zA-Z0-9]{6,14}$/;
                    if(!reg.test(value)){
                        callback(new Error('请输入6-14位数字或中英文字符'))
                    }
                    if (value !== self.formlist.passWord) {
					    callback(new Error('两次输入密码不一致!'))
                    }
                }
                callback()
            }
            return {
                idIndex:'',
                dialogs:false,
                dialogVisibleable:false,
                closeId:'',//销户Id
                 id:'',  //激活id
                multipleSelection:[],
                dialog:false,
                dialogVisible:false,
                //销毁日期
                destructionDate:{
                    time:'',
                },
                formlist:{
                     number:'',
                     name:'',
                     checkPass:'',
                     passWord:'',
                     telephone:'',
                     role:'',
                     email:'',
                     gender:'',
                     week:'',
                     provinces:'',
                     applicant:'',
                     school:'',
                      provincesList:[
                            {
                             value: '1',
                            label: '北京'
                            }, {
                            value: '2',
                            label: '天津'
                            },
                            {
                            value: '3',
                            label: '重庆'
                            },
                            {
                            value: '4',
                            label: '河北'
                            },
                            {
                            value: '5',
                            label: '山西'
                            },
                            {
                            value: '6',
                            label: '辽宁'
                            },
                            {
                            value: '7',
                            label: '吉林'
                            },
                            {
                            value: '8',
                            label: '黑龙江'
                            },
                            {
                            value: '9',
                            label: '江苏'
                            },
                            {
                            value: '10',
                            label: '浙江'
                            },
                            {
                            value: '11',
                            label: '安徽'
                            },
                            {
                            value: '12',
                            label: '福建'
                            },
                            {
                            value: '13',
                            label: '江西'
                            },
                            {
                            value: '14',
                            label: '山东'
                            },
                            {
                            value: '15',
                            label: '河南'
                            },
                            {
                            value: '16',
                            label: '湖南'
                            },
                            {
                            value: '17',
                            label: '湖北'
                            },
                            {
                            value: '18',
                            label: '广东'
                            },

                            {
                            value: '19',
                            label: '四川'
                            },
                            {
                            value: '20',
                            label: '贵州'
                            },
                            {
                            value: '21',
                            label: '云南'
                            },
                            {
                            value: '22',
                            label: '陕西'
                            },
                            {
                            value: '23',
                            label: '甘肃'
                            },
                            {
                            value: '24',
                            label: '青海'
                            },
                            {
                            value: '25',
                            label: '内蒙古'
                            },
                            {
                            value: '26',
                            label: '广西'
                            },
                            {
                            value: '27',
                            label: '西藏'
                            },
                            {
                            value: '28',
                            label: '宁夏'
                            },
                            {
                            value: '29',
                            label: '新疆维吾尔自治区'
                            },
                            {
                            value: '30',
                            label: '新疆'
                            },
                            {
                            value: '31',
                            label: '上海'
                            },
                            {
                            value: '32',
                            label: '海南'
                            },

                        ],

                      options: [{
                        label: '普通教师'
                        },{
                        label: '高校教师'
                        },
                        {
                        label: '销售教师'
                        },
                    ],
                },
                formlist2:{
                     number:'',
                     name:'',
                     checkPass:'',
                     passWord:'',
                     telephone:'',
                     role:'',
                     email:'',
                     gender:'',
                     week:'',
                     provinces:'',
                     applicant:'',
                     school:'',
                       provincesList:[
                            {
                             value: '1',
                            label: '北京'
                            }, {
                            value: '2',
                            label: '天津'
                            },
                            {
                            value: '3',
                            label: '重庆'
                            },
                            {
                            value: '4',
                            label: '河北'
                            },
                            {
                            value: '5',
                            label: '山西'
                            },
                            {
                            value: '6',
                            label: '辽宁'
                            },
                            {
                            value: '7',
                            label: '吉林'
                            },
                            {
                            value: '8',
                            label: '黑龙江'
                            },
                            {
                            value: '9',
                            label: '江苏'
                            },
                            {
                            value: '10',
                            label: '浙江'
                            },
                            {
                            value: '11',
                            label: '安徽'
                            },
                            {
                            value: '12',
                            label: '福建'
                            },
                            {
                            value: '13',
                            label: '江西'
                            },
                            {
                            value: '14',
                            label: '山东'
                            },
                            {
                            value: '15',
                            label: '河南'
                            },
                            {
                            value: '16',
                            label: '湖南'
                            },
                            {
                            value: '17',
                            label: '湖北'
                            },
                            {
                            value: '18',
                            label: '广东'
                            },

                            {
                            value: '19',
                            label: '四川'
                            },
                            {
                            value: '20',
                            label: '贵州'
                            },
                            {
                            value: '21',
                            label: '云南'
                            },
                            {
                            value: '22',
                            label: '陕西'
                            },
                            {
                            value: '23',
                            label: '甘肃'
                            },
                            {
                            value: '24',
                            label: '青海'
                            },
                            {
                            value: '25',
                            label: '内蒙古'
                            },
                            {
                            value: '26',
                            label: '广西'
                            },
                            {
                            value: '27',
                            label: '西藏'
                            },
                            {
                            value: '28',
                            label: '宁夏'
                            },
                            {
                            value: '29',
                            label: '新疆维吾尔自治区'
                            },
                            {
                            value: '30',
                            label: '新疆'
                            },
                            {
                            value: '31',
                            label: '上海'
                            },
                            {
                            value: '32',
                            label: '海南'
                            },

                        ],
                      options: [{
                        label: '普通教师'
                        },{
                        label: '高校教师'
                        },
                        {
                        label: '销售教师'
                        },
                    ],
                },
                Form:{
                    info:'',
                    role:'',
                     options: [{
                        label: '普通教师'
                        },{
                        label: '高校教师'
                        },
                        {
                        label: '销售教师'
                     }],
                },
                 rules: {
                    name: [
                        { required: true, message: '请输入姓名', trigger: 'blur' }
                    ],
                    // email: [
                    //     { required: true, message: '请输入邮箱', trigger: 'blur' },
                    //     { required: true, validator: validateEmail, trigger: 'blur' }
					// ],
                    number: [
                        { required: true, message: '请输入工号', trigger: 'blur' }
                    ],
                    role: [
                        { required: true, message: '请输入角色', trigger: 'blur' }
                    ],
                    people: [
                        { required: true, message: '请输入申请人', trigger: 'blur' }
                    ],
                    // school: [
                    //     { required: true, message: '请输入学校', trigger: 'blur' }
                    // ],
                    passWord: [
                        { required: true, message: '请输入密码', trigger: 'blur' },
						{ required: true, validator: validatePass, trigger: 'blur' }
					],
					checkPass: [
                        { required: true, message: '请输入确认密码', trigger: 'blur' },
						{ required: true, validator: validatePass2, trigger: 'blur' }
                    ]
                },
                currentPage: 1,
                pagesize: 10,
                totalCount: 1000,
                tableData: [],
                pickerBeginDateBefore: {
                    disabledDate: (time) => {
                        return (time.getTime() + 3600 * 1000 * 24) < Date.now();
                    }
                },
             }
        },
        created() {
            //此处需要得到角色身份
            this.init()
        },
        methods: {
            init(){
                 let self = this
                self.$http.get('/tes/user/page?pageNum='+self.currentPage+'&pageSize='+self.pagesize+'&identity='+1+'&roleName='+self.Form.role+'&userInfo='+self.Form.info).then(response => {
                    let res = response.data
                    if(res.code == '200'){
                         self.tableData = res.data.content
                         self.totalCount = res.data.total
                    }else{
                        self.$message.error(res.message)
                    }
                })
            },
            changeTime(date){
                this.pickerBeginDateAfter = {
                    disabledDate(time) {  //开始时间-结束时间
                        return (time.getTime() < new Date(date).getTime());
                    }
                }
            },
             //激活
            active(id,status){
               this.dialog=true
               this.id=id

            },

            //修改关闭弹窗
            closeDialogaa(){
              this.$refs.formlist2.resetFields()
            },
            //全选
			handleSelectionChange(val) {
				let valArr = []
				for(let i = 0; i < val.length; i++){
					valArr.push(val[i].id)
				}
				this.multipleSelection = valArr
            },
            //关闭弹窗
            closeDialog(){
                this.$refs.formlist.resetFields()
            },
            closeDialogDate(){
                this.destructionDate.time=''
            },
            //搜索
            searchFn(){
                this.currentPage = 1
                this.init()
            },
            //添加保存
            submit(formlist){
                let self = this
                self.$refs[formlist].validate((valid) => {
                    if (valid) {
                        const loading = this.$loading({
                            lock: true,
                            text: '正在保存中...',
                            spinner: 'el-icon-loading',
                            background: 'rgba(0, 0, 0, 0.7)'
                        })
                        self.$http.post('/tes/user?identity=1',{
                           name:self.formlist.name,
                           userNumber:self.formlist.number,
                           telephoneNumber:self.formlist.telephone,
                           applicant:self.formlist.applicant,
                           destroyTimeStr: self.formlist.week,
                           email:self.formlist.email,
                           province:self.formlist.provinces,
                           roleName:self.formlist.role,
                           schoolName:self.formlist.school,
                           sexName:self.formlist.gender,
                           password:self.formlist.passWord,
                        }).then((response) => {
                            let res = response.data
                            if(res.code == '200') {
                                self.$message({
                                    message: '保存成功',
                                    type: 'success'
                                })
                                self.init()
                                self.dialogVisible=false
                                loading.close()
                               // this.$refs[formlist].resetFields()

                            }else{
                                self.$message.error(res.message)
                                loading.close()
                            }
                        })
                    }
                })
            },
            //修改保存
            submitFn(formlist2){
                let self = this
                self.$refs[formlist2].validate((valid) => {
                    if (valid) {
                        self.$http.put('/tes/user/'+self.idIndex+'?identity=1',{
                           name:self.formlist2.name,
                           userNumber:self.formlist2.number,
                           telephoneNumber:self.formlist2.telephone,
                           applicant:self.formlist2.applicant,
                           destroyTimeStr: self.formlist2.week,
                           email:self.formlist2.email,
                           province:self.formlist2.provinces,
                           roleName:self.formlist2.role,
                           schoolName:self.formlist2.school,
                           sexName:self.formlist2.gender,
                           password:self.formlist2.passWord,
                        }).then((response) => {
                            let res = response.data
                            if(res.code == '200') {
                                self.$message({
                                    message: '保存成功',
                                    type: 'success'
                                })
                                self.init()
                                self.dialogVisibleable=false
                            }else{
                                self.$message.error(res.message)
                            }
                        })
                    }
                })
            },
            //激活保存
            Save(){
                let self = this
                self.$http.put('/tes/user/'+self.id+'/status',{
                   status: 1,
                   destroyTimeStr: self.destructionDate.time
                }).then(response => {
                    let res = response.data
                    if(res.code == '200'){
                        self.$message({
                            message: '激活成功',
                            type: 'success'
                        })
                         self.init()
                         self.dialog=false
                    }else{
                        self.$message.error(res.message)
                    }
                })
            },
            //销户
            cacncel(id){
                let self = this
                self.$http.put('/tes/user/'+id+'/status',{
                   status: 2,
                   destroyTimeStr: ''
                }).then(response => {
                    let res = response.data
                    if(res.code == '200'){
                         self.$message({
                            message: '注销成功',
                            type: 'success'
                        })
                    self.init()
                    }else{
                        self.$message.error(res.message)
                    }
                })
            },
            //添加
            add(){
              this.dialogVisible=true
            },
             //删除方法
            commonFn(id,message){
                    let self = this
                    self.$confirm(''+message+',确定删除吗？', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                    }).then(() => {
                    self.$http.post('/tes/user/batch-delete?errorFlag=true',self.multipleSelection) .then((response) => {
                        let res = response.data
                        if(res.code == '200') {
                            self.$message({
                                message: '删除成功',
                                type: 'success'
                            })
                            self.init()
                        }else{
                            self.$message.error(res.message)
                        }
                    }).catch(() => {
				    })
                })
            },
            //批量删除
            deleteAll(){
                let self = this;
				if(self.multipleSelection.length == 0){
                    self.$message({
                        message: '请选择要删除的内容',
                        type: 'warning'
                    })
					return
                }
				self.$confirm('是否删除选中?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					self.$http.post('/tes/user/batch-delete?errorFlag=',self.multipleSelection).then((response) => {
						let res = response.data;
						if(res.code == '200'){
                            self.$message({
                                message: '删除成功',
                                type: 'success'
                            })
							self.currentPage = 1
							self.init()
                        }else if(res.code == '501'){
                            self.commonFn(self.multipleSelection,res.message)

                        }else{
                            self.$message.error(res.message)
                        }
					},(err) => {
						console.log('err');
					})
				}).catch(() => {
				})

            },
            //修改
            repeatFn(id,name,userNumber,sexName,roleName,telephoneNumber,email,applicant,destroyTime,province,schoolName){
                this.idIndex=id,
                this.dialogVisibleable=true,
                this.formlist2.name = name,
                this.formlist2.number = userNumber,
                this.formlist2.gender = sexName,
                this.formlist2.role = roleName,
                this.formlist2.telephone = telephoneNumber,
                this.formlist2.email = email,
                this.formlist2.applicant = applicant,
                this.formlist2.week = destroyTime,
                this.formlist2.provinces = province,
                this.formlist2.school = schoolName

            },
            //初始化密码
            repeatCode(id){
                let self = this
                self.$http.put('/tes/user/'+id+'/init-password').then(response => {
                    let res = response.data
                    if(res.code == '200'){
                        self.$message({
                            message: '修改成功',
                            type: 'success'
                        })
                    }else{
                        self.$message.error(res.message)
                    }
                })
            },

            //分页
			handleSizeChange: function (size) {
				this.pagesize = size;
			},
			handleCurrentChange: function(currentPage) {
                this.currentPage = currentPage
                this.init()
            },
        }
    }
</script>
<style scoped>
.el-picker-panel{
  width: 330px !important;
}
 .el-select>>>.el-input__inner{
     width: 190px;
}

.el-form-item>label{
    text-align: right
}
.el-form--inline>>>.el-form-item__label {
    text-align: right;
    float: left;
    display: inline-block;
    width: 90px;
}
.el-form >>>.el-input__inner{
     width: 190px;
     line-height: 32px;
}
</style>
<style lang="scss" scoped>
@import "./../../../styles/layout/color_variables";
 #InterNet {
    width: $width;
    margin: 20px auto;
    color: #727272;
      .topcoumt{
       overflow: hidden;
        .button-style{
           margin-right: 15px;
        }
     }
 }
</style>
